<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>HealthVault Eventing Sample</title>
</head>
<body>
                <h1>HealthVault Eventing Sample</h2>  <br /><br />
                
                <p>The HealthVault Eventing Sample application provides two services.</p>
                <p>First, it demonstrates how to create, update, and modify subscriptions.</p>
                <p>Seceond, it provides a way to simulate notification messages to applications.</p>

<div id="c_divApplicationId" runat="server" visible="false">

<h2>Application setup required</h2>

<p>
This sample needs an separate application to run. There are two ways to do this:

<h3>Create your own application for this sample</h3>

<ol>
<li>
Please add the following line to the &lt;appSettings&gt section of the web.config file:
</p>

<pre id="c_ApplicationIdValue" runat="server" />
</li>
<li>
Go to the online <a href="https://config.healthvault-ppe.com/default.aspx"></a>Application Configuration Center</a>
</li>
<li>
Create a new application, specifying the application id that you placed in the web.config file, and uploading a certificate (you can use the
one in this sample or create your own).
</li>
<li>
Update the ApplicationCertificateFileName key in the web.config file to point to the .pfx certificate file that you are using.
</li>
<li>
Select the application to edit it.
</li>
<li>
On the Methods tab, check the "Application requires access to Eventing methods" checkbox and save.
</li>
<li>
In the Online Rules tab, add a rule to access the types on which you wish to receive notifications.
</li>
<li>
Do the same thing on the Offline Rules tab. 
</li>
</ol>

<h3>Use an existing application's setup</h3>

<ol>
<li>
Copy the application id setting into your web.config file.
</li>
<li>
Update the ApplicationCertificateFileName key in the web.config file to point to the .pfx certificate file that you are using.
</li>
<li>
Go to the online <a href="https://config.healthvault-ppe.com/default.aspx"></a>Application Configuration Center</a>
</li>
<li>
Select the application to edit it.
</li>
<li>
On the Methods tab, check the "Application requires access to Eventing methods" checkbox and save.
</li>
<li>
In the Online Rules tab, add a rule to access the types on which you wish to receive notifications.
</li>
<li>
Do the same thing on the Offline Rules tab. 
</li>
</ol>

<p>


</p>

</div>

<div id="c_divKeyCreation" runat="server" visible="false">

<h2>Subscription authentication key setup required</h2>

<p>
Subscriptions have an associated key that can be used by the recipient of the notification to verify that 
it came from HealthVault. The sample key is missing from the web.config or is an improper format. 
This sample needs a key defined in the web.config file to operate correctly. The following line contains a randomly-generated key; 
please add it to the &lt;appSettings&gt section of the web.config file:
</p>

<pre id="c_keyValue" runat="server" />

<p>

Alternatively, you can generate the key yourself. The key is 64 bytes in length and is stored in the web.config as a base64-encoded string.

</p>

</div>


                <a id="_manageLink" runat="server" href="Subscriptions.aspx">Manage Subscriptions</a>                
</body>
</html>
